<template>
  <div>
    <CustomForm :customFields="findPasswordFields" :handleSubmit="submit"/>
  </div>
</template>

<script setup lang="ts">
import CustomForm from './basicForm.vue';
import { GoPageName } from "@/enums/index.ts"


// 提交接口函数
const submit = (data: any) => {
  console.log('提交数据', data);
}

// 传给自定义组件的参数
const findPasswordFields = {
  title: '修改密码',
  btnTitle: "确认",
  type: GoPageName.UPDATEPASSWORD,
  inputData: [
    {
      lable: "newPassword", value: "", inputPlaceholder: '请输入新密码', type: "password"
    },
    {
      lable: "checkPassword", value: "", inputPlaceholder: '请再次输入密码', type: "password"
    },
  ],
  rules: [
    [{ required: true, message: '请检查密码格式是否正确', trigger: 'blur' },],
    [{ required: true, message: '请检查密码是否一致', trigger: 'blur' },]
  ],
};
</script>
